package com.college.controller;

import com.college.DTO.studentDTO.CourseInfoDTO;
import com.college.DTO.studentDTO.CreditDTO;
import com.college.DTO.studentDTO.InstituteInfoDTO;
import com.college.DTO.studentDTO.StudentMeetDTO;
import com.college.entity.BorrowInfo;
import com.college.entity.CourseInfo;
import com.college.entity.StudentInfo;
import com.college.service.BorrowInfoService;
import com.college.service.StudentInfoService;
import com.college.utils.R;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 学生信息 前端控制器
 * </p>
 *
 * @author yoki
 * @since 2024-05-29
 */
@RestController
@RefreshScope
@RequestMapping("/studentInfo")

public class StudentInfoController {
    @Resource
    private StudentInfoService studentInfoService;
    @Resource
    private BorrowInfoService borrowInfoService;


    @GetMapping("/getBorrow")
    public R<BorrowInfo> getBorrow()
    {
        BorrowInfo byId = borrowInfoService.getById(1);
        System.out.println(byId.getBookNumber());
        return R.success(byId);
    }
    @GetMapping("/getMeet")
    public R<StudentMeetDTO> getMeet(@RequestParam String num)
    {
        return studentInfoService.getMeetByNum(num);
    }

    @GetMapping("/getInstitute")
    public R<InstituteInfoDTO> getInstitute(@RequestParam String num)
    {
        return studentInfoService.getInstitute(num);
    }
    @GetMapping("/getCourseInfo")
    public R<CourseInfoDTO> getCourseInfo(@RequestParam String num)
    {

        return studentInfoService.getCourseInfo(num);
    }
    @GetMapping("/getCredit")
    public R<CreditDTO> getCredit(@RequestParam String num)
    {
        return studentInfoService.getCredit(num);
    }
    @GetMapping("/getScore")
    public R<CourseInfo> getScore()
    {
        return null;
    }

}
